<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <title>卡支付</title>
</head>

<body>

    <div id="vue-root">

        <div>费用：{{school.cardFee/100}} </div>
        <div>续费时长：{{school.cardDuration}}天</div>

        <button @click="wxpay">微信支付</button>

    </div>

    <script src="/scriptZIP/vue.min.js"></script>
    <script src="/scriptZIP/axios.min.js"></script>

    <script src="/js/common.js"></script>

    <script>
        var app = new Vue({
            el: '#vue-root',
            data: {
                school: {
                    id: getPerson().schoolId
                },
                prefix: isTeacher() ? '/t' : '/s'
            },
            created: function () {
                axios.get('/api/school/' + this.school.id).then(function (res) {
                    this.school = res.data;
                }.bind(this));
            },
            methods: {
                wxpay: function () {
                    axios.get(this.prefix + '/wxpay?type=1').then(function (res) {
                        WeixinJSBridge.invoke('getBrandWCPayRequest', res.data, function (res) {
                            if (res.err_msg == "get_brand_wcpay_request:ok") {
                                
                            }
                        });
                    });
                }
            }
        });

    </script>

</body>

</html>